package jogs.client.listeners;

import javax.swing.JTabbedPane;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;

import jogs.client.ClientFrame;

public class TabChangeListener implements ChangeListener
{

	private ClientFrame client;
	
	public TabChangeListener(ClientFrame _client)
	{
		client = _client;
	}

	public void stateChanged(ChangeEvent evt)
	{
		 JTabbedPane pane = (JTabbedPane)evt.getSource();
        // Get current tab
		 int sel = pane.getSelectedIndex();
		 client.tabbChangedEvent(sel);
	}

}